package net.adetech.crj.service;

import com.alibaba.fastjson.JSONObject;
import net.adetech.crj.utils.ServiceUtil;
import net.adetech.framework.entity.ServiceRequest;
import net.adetech.framework.entity.ServiceResponse;
import net.adetech.framework.utils.SerializeUtil;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.util.EntityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Service("cjg.call")
public class OuterCJGCallService implements BaseService {

    @Autowired
    ServiceUtil serviceUtil;

    @Override
    public Map<String, Object> invoke(Map<String, Object> params) {
        ServiceRequest serviceRequest = new ServiceRequest();
        serviceRequest.setServiceName("cjg.service");
        serviceRequest.setParams(params);
        ServiceResponse response = serviceUtil.call(serviceRequest);
        return response.getResults();
    }
}
